use axum::{routing, Router};
use redis::redis_pool;
use serde::Deserialize;
use tokio::net::TcpListener;

mod logger;
mod config;
mod database;
mod redis;
mod router;
mod token;
mod error;
mod service;
mod mapper;
mod state;
mod entity;
mod filter;
mod server;
mod utils;

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    logger::initial()?;
    tracing::info!("初始化数据库");
    database::initial().await?;
    tracing::info!("初始化Redis");
    redis_pool::log_redis_version().await?;
    server::start().await?;
    Ok(())
}